//
//  UIApplication+RACSignalSupport.m
//  RACObjc_Example
//
//  Created by 李阳 on 2018/6/12.
//  Copyright © 2018年 liyang. All rights reserved.
//

#import "UIApplication+RACSignalSupport.h"
#import "NSNotificationCenter+RACSupport.h"


@implementation UIApplication (RACSignalSupport)

- (RACSignal *)willResignActiveSignal
{
    return [NSNotificationCenter.defaultCenter rac_addObserverForName:UIApplicationWillResignActiveNotification object:self];
}

- (RACSignal *)didBecomeActiveSignal
{
    return [NSNotificationCenter.defaultCenter rac_addObserverForName:UIApplicationDidBecomeActiveNotification object:self];
}

- (RACSignal *)didEnterBackgroundSignal
{
    return [NSNotificationCenter.defaultCenter rac_addObserverForName:UIApplicationDidEnterBackgroundNotification object:self];
}

- (RACSignal *)willEnterForegroundSignal
{
    return [NSNotificationCenter.defaultCenter rac_addObserverForName:UIApplicationWillEnterForegroundNotification object:self];
}

- (RACSignal *)userDidTakeScreenshotSignal
{
    return [NSNotificationCenter.defaultCenter rac_addObserverForName:UIApplicationUserDidTakeScreenshotNotification object:self];
}

@end
